package com.heima.feigns.article;

import com.heima.model.article.dto.ArticleDto;
import com.heima.model.article.pojo.ApAuthor;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.search.vo.SearchArticleVo;
import com.heima.model.wemedia.pojo.WmNews;
import com.heima.model.wemedia.pojo.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * Created by ZYJ on 2021/5/25 19:25
 */
@FeignClient("leadnews-article")
public interface ArticleFeign {

    @GetMapping("/api/v1/author/findByUserId/{userId}")
    public ApAuthor findByUserId(@PathVariable("userId") Integer userId);

    @PostMapping("/api/v1/author/save")
    public ResponseResult save(@RequestBody ApAuthor apAuthor);

    @PostMapping("api/v1/article/save")
    public ResponseResult saveArticle(@RequestBody ArticleDto articleDto);
    @GetMapping("/api/v1/author/one/{id}")
    public ApAuthor findById(@PathVariable("id") Integer id);
    @GetMapping("/api/v1/article/{id}")
    SearchArticleVo findArticle(@PathVariable("id") Long id);

}
